import fetch from './request.js'

const api = {}

// 注册获取验证码
// 参数 地址 实体 请求方式   true 'application/x-www-form-urlencoded' : 'application/json',  是否隐藏加载框

// //登录
// api.login = params => fetch.request("xboot/user/appLogin", params, "POST", true, false)

// // 微信登录
// api.wclogin = params => fetch.request("app/login/wclogin", params, "POST", true, false)

// //账户绑定微信
// api.bindingWechat = params => fetch.request("app/login/bindingWechat", params, "POST", true, false)

// 获取协议
api.getProtolInfo = (urlParams,params) => fetch.request(`findProtocolByType/${urlParams}`, params, "GET", true, true)

// 用户登陆
api.userLogin = params => fetch.request("login", params, "POST", false, false)

// 用户注册
api.weiXinRegister = params => fetch.request("register", params, "POST", false, false)

// 短信验证码
api.getVerifyCode = params => fetch.request("register/verify", params, "POST", false, false)

// 注册
api.getUserRegister = params => fetch.request("register", params, "POST", false, false)

// 绑定手机号
api.getBindPhone = params => fetch.request("bindingPhone", params, "POST", false, false)

// //获取用户信息
api.getUserInfo = params => fetch.request("userinfo", params, "GET", false, true)

// 忘记密码
api.forgetPassword = params => fetch.request("forgetPwd", params, "POST", false, true)

// 拍卖商城首页轮播
api.indexBannerInfo = params => fetch.request("newIndex", params, "GET", true, true)

// 获取客服电话
api.getServiceTel = (urlParams,params) => fetch.request(`findAppdictByCode/${urlParams}`, params, "GET", true, true)

// 进行抢拍
api.startSnapping = (urlParams,params) => fetch.request(`productOrder/seckillRecord/${urlParams}`, params, "GET", true, true)


// 拍卖首页
// api.indexHome = (urlParams,params) => fetch.request(`productRecord/example/${urlParams}`, params, "GET", true, true)

// 首页拍卖列表   
api.indexHomeList = params => fetch.request("productRecord/example", params, "GET", true, true)

// 根据首页查询时间段更多列表
api.homeListMore = (urlParams,params) => fetch.request(`productRecord/list/${urlParams}`, params, "GET", true, true)

// 抢拍详情 /api/productRecord/detail/{id}
api.homeAuctionDeatil = (urlParams,params) => fetch.request(`productRecord/detail/${urlParams}`, params, "GET", true, true)

// 查询支付方式信息
api.getPayInfo = params => fetch.request("getAccountByType", params, "POST", true, true)

// 上传支付凭证
api.uploadPayInfo = params => fetch.request("productOrder/payOrder", params, "POST", false, true)

// 我的买单
api.userBuyBill = (urlParams,params) => fetch.request(`productOrder/productOrderPage/${urlParams}`, params, "GET", true, true)

// 我的买单详情
api.buyBillOrderDetail = (urlParams,params) => fetch.request(`productOrder/findAuctionOrderDetail/${urlParams}`, params, "GET", true, true)

// 发起转拍支付手续费
api.userSponsorTransition = params => fetch.request("productOrder/turnAuction", params, "GET", false, true)

// 设置支付密码
api.userSetpayPassword = params => fetch.request("user/setPayPassword", params, "POST", false, true)

// 绑定支付宝
api.userBindAlipay = params => fetch.request("updateZFbAccount", params, "POST", false, true)

// 绑定微信
api.userBindWeipay = params => fetch.request("updateWXAccount", params, "POST", false, true)

// 绑定银行卡
api.userBindBank = params => fetch.request("bindBank", params, "POST", false, true)



// 我的买单历史记录
api.userPayBillHistory = (urlParams,params) => fetch.request(`productOrder/productHistoryOrderPage/${urlParams}`, params, "GET", true, true)

// 我的买单，待付款取消
api.cancelUserpay = (urlParams,params) => fetch.request(`productOrder/cancelOrder/${urlParams}`, params, "GET", true, false)


// 获取订单数据
api.userGetPayOrder = (urlParams,params) => fetch.request(`productOrder/confirmOrder/${urlParams}`, params, "GET", true, true)

// 地址列表
api.userAddressList = params => fetch.request("address/list", params, "GET", true, true)

// 新增或者修改地址
api.userAddAddress = params => fetch.request("address/edit", params, "POST", false, true)

// 根据id查询地址详情
api.getUserAddressDetail = (urlParams,params) => fetch.request(`address/detail/${urlParams}`, params, "GET", true, true)

// 根据地址id删除地址
api.cancelUserAddress = params => fetch.request("address/del", params, "POST", false, true)

// 设为默认地址
api.userSetDefaultAddress = params => fetch.request("address/default/set", params, "POST", false, true)

// 拍卖确认订单
api.auctionSureOrder = params => fetch.request("productOrder/confirm", params, "GET", true, true)

// 拍卖订单确认收货
api.userGetConfirm = (urlParams,params) => fetch.request(`productOrder/finishOrder/${urlParams}`, params, "GET", true, true)

// 我的卖单
api.userSaleBill = (urlParams,params) => fetch.request(`productRecord/orderPage/${urlParams}`, params, "GET", true, true)

// 我的卖单详情
api.userSaleOrderDetail = (urlParams,params) => fetch.request(`productRecord/productReocrdDetail/${urlParams}`, params, "GET", true, true)

// 我的卖单确认收款
api.sureConfirGathering = (urlParams,params) => fetch.request(`productRecord/confirmPay/${urlParams}`, params, "GET", true, true)

// 修改手机号码
api.userChangePhone = params => fetch.request("changePhone", params, "POST", false, true)

// 获取签到列表
api.getUserSign = params => fetch.request("sign/list", params, "GET", true, true)

// 获取签到配置
api.getUserSignSet = params => fetch.request("sign/config", params, "GET", true, true)

// 开始签到
api.getSignStar = params => fetch.request("sign/integral", params, "POST", true, true)

// 通宝明细
api.UserIntergral = params => fetch.request("integral/list", params, "GET", true, true)

// 获取签到信息
api.getUserSignInfo = params => fetch.request("sign/user", params, "POST", true, true)

// 修改个人信息
api.changeUsewrInfo = params => fetch.request("user/edit", params, "POST", false, true)

// 获取充值方案
api.getRechargeCard = params => fetch.request("recharge/index", params, "GET", false, true)

// 充值
api.userToRecharge = params => fetch.request("recharge/money", params, "GET", false, true)

// 消费明明
api.userExpenseDetail = params => fetch.request("userBill/list", params, "GET", false, true)

// 用户提现
api.getUserWithdraw = params => fetch.request("extract/cash", params, "POST", false, true)

// 我的佣金
api.getUserBrokrrage = params => fetch.request("distributor/index", params, "GET", true, true)

// 我的佣金明细
api.userBrokerageDetail = params => fetch.request("distributor/detail", params, "GET", true, true)

// 队员佣金详情
api.otherUserBrokerageDetail = params => fetch.request("distributor/otherDetail", params, "GET", true, true)

// 实名认证
api.authentication = params => fetch.request("authentication/applyAuthentication", params, "POST", false, true)

// 获取认证详情
api.authenticationDetail = params => fetch.request("authentication/applyAuthenticationDetail", params, "GET", false, true)

// 常见问题
api.getProblemInfo = params => fetch.request("findProblemList", params, "GET", true, true)

// 问题解答
api.getProblemDetail = (urlParams,params) => fetch.request(`findProblemDetail/${urlParams}`, params, "GET", true, true)

// 通宝商城
// 通宝商城首页获取轮播和推荐
api.integralIndexBanner = params => fetch.request("findIntegeralStoreIndex", params, "GET", true, true)

// 通宝商城根据分类id查询分类列表
api.integralCategorys = params => fetch.request("productsPage", params, "GET", true, true)

// 商城商品详情   /api/product/detail/{id}
api.integralProductInfo = (urlParams,params) => fetch.request(`product/detail/${urlParams}`, params, "GET", true, true)

// 获取全部评价 /api/reply/page/{id}
api.integralEvaluate = (urlParams,params) => fetch.request(`reply/page/${urlParams}`, params, "GET", true, true)

// 加入购物车
api.integralAddCar = params => fetch.request("cart/add", params, "POST", false, true)

// 根据购物车id查询订单信息
api.integralSureOrder = params => fetch.request("order/confirm", params, "POST", false, true)

// 购物车列表
api.shoppingCarList = params => fetch.request("cart/list", params, "GET", true, true)

// 更改购物车数量
api.shoppingCarChangeNum = params => fetch.request("cart/num", params, "POST", false, true)

// 删除购物车
api.shoppingCarCancel = params => fetch.request("cart/del", params, "POST", false, true)

// 获取公告信息
api.userNoticeList = params => fetch.request("userNews/page", params, "GET", true, true)

// 公告详情
api.userNoticeInfo = params => fetch.request("userNews/details", params, "GET", true, true)

// 删除公告
api.userNoticeCancel = params => fetch.request("userNews/deleteNews", params, "GET", true, true)

// 创建订单
api.userCreationOrder = (urlParams,params) => fetch.request(`order/createOrder/${urlParams}`, params, "POST", false, true)

// 订单支付
api.userOrderPayment = params => fetch.request("order/newPay", params, "POST", false, true)

// 获取商城通宝订单
api.getShoppingOrder = params => fetch.request("order/page", params, "GET", true, true)
 
 // 取消未付款订单
 api.cancelShoppingOrder = params => fetch.request("order/del", params, "POST", false, true)

// 商城订单详情 /api/order/detail/{key}
api.shoppingOrderDetail = (urlParams,params) => fetch.request(`order/detail/${urlParams}`, params, "GET", true, true)

// 获取退款原因 
api.getRefundReason = params => fetch.request("order/refund/reason", params, "GET", true, true)

// 提交退款申请
api.pickUpRefund = params => fetch.request("order/refund/verify", params, "POST", false, true)

// 售后订单列表
api.getAfterSalesList = params => fetch.request("order/afterPage", params, "GET", true, true)

// 确认收货
api.userSureGoods = params => fetch.request("order/take", params, "POST", false, true)

// 评价商品
api.getGoodsAppraise = params => fetch.request("order/comment", params, "POST", false, true)

// 撤销退款申请
api.backoutApply = params => fetch.request("order/refund/returnRefund", params, "POST", false, true)

// 搜索
api.userSearchName = params => fetch.request("productsSearch",params, "GET", false, true)

// 获取版本号
api.findVersionNumber = (urlParams,params) => fetch.request(`findAppdictByCode/${urlParams}`, params, "GET", false, true)

// 一键转拍
api.userOneKeyTransition = params => fetch.request("productOrder/oneKeyAuction",params, "GET", true, true)

// 获取一键转拍费用
api.haveOnekeyTransitionFee = params => fetch.request("productOrder/findTotalMoney",params, "GET", true, true)

// 获取抽奖列表
api.drawAlottery = params => fetch.request("rotarytable/goods",params, "GET", true, true)

// 存入抽奖记录
api.depositDrawRecord = params => fetch.request("rotarytable/inputInformation",params, "POST", false, true)

// 获取抽奖记录
api.checkDrawRecord = params => fetch.request("rotarytable/record",params, "GET", true, true)

// 点击抽奖
api.clickTheDraw = params => fetch.request("rotarytable/draw",params, "GET", true, true)

// 获取商城列表
api.shoppinglist = params => fetch.request("findShopList",params, "GET", true, true)

// 获取规则
api.getRulesList = params => fetch.request("findGuideList",params, "GET", true, true)







export default api
